package com.example

import org.apache.flink.api.scala._
import org.apache.flink.api.scala.ExecutionEnvironment
import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment

object SourceDemo1 {

  def main(args: Array[String]): Unit = {
    // 批处理
    val env = ExecutionEnvironment.getExecutionEnvironment
    //    流处理
    //    val senv: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment
    val ds1: DataSet[String] = env.fromElements("spark", "flink")
    ds1.print()

//    env.execute()

    val ds2: DataSet[(Int, String)] = env.fromElements((1, "spark"), (2, "flink"))
    ds2.print()

    val df3: DataSet[String] = env.fromCollection(Array("spark", "flink"))
    df3.print()

    val df4: DataSet[Long] = env.generateSequence(1, 9)
    df4.print()






  }

}
